/**
 * 用于配置路由规则
 */
import { lazy } from "react";
import { type RouteObject } from "react-router-dom";

const Home = lazy(() => import("../views/home"));
const Products = lazy(() => import("../views/products"));
const ProductsNew = lazy(() => import("../views/products-new"));
const ProductInfo = lazy(() => import("../views/product-info"));
const Login = lazy(() => import("../views/login"));
const Account = lazy(() => import("../views/account"));
const Orders = lazy(() => import("../views/orders"));
const Search = lazy(() => import("../views/search"));

export const routes: RouteObject[] = [
  { path: "/", element: <Home /> },
  { path: "/products", element: <Products /> },
  { path: "/products-new", element: <ProductsNew /> },
  { path: "/productInfo/:productId", element: <ProductInfo /> },
  { path: "/login", element: <Login /> },
  { path: "/account", element: <Account /> },
  { path: "/orders", element: <Orders /> },
  { path: "/search", element: <Search /> },
];
